package com.sky.anotion;

import com.sky.anotion.validator.ValidSnowflakeIdValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = ValidSnowflakeIdValidator.class)
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidSnowflakeId {
    String message() default "非法的 Snowflake ID，必须是14位数字字符串";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
